package com.toilet.easyvideo.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.toilet.easyvideo.domain.UploadFile;
import com.toilet.easyvideo.service.UploadFileService;
import com.toilet.easyvideo.mapper.UploadFileMapper;
import org.springframework.stereotype.Service;

/**
 * @author 11
 * @description 针对表【upload_file】的数据库操作Service实现
 * @createDate 2023-12-06 21:55:25
 */
@Service
public class UploadFileServiceImpl extends ServiceImpl<UploadFileMapper, UploadFile>
        implements UploadFileService {

    @Override
    public Boolean selectFileByMd5(String md5) {
        UploadFile uploadFile = lambdaQuery().eq(UploadFile::getFileMd5, md5).one();
        if (ObjectUtil.isEmpty(uploadFile)) {
            return Boolean.FALSE;
        }
        return Boolean.TRUE;
    }
}




